package cn.edu.java.object;

import lombok.NoArgsConstructor;



@NoArgsConstructor
public class Worker extends Person{
    String work;

    public Worker(String name,int age, String work) {
        super(name, age);
        this.work = work;
    }


    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", work='" + work + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Worker worker = new Worker("王二", 18, "teacher");

        worker.say();
    }


}
